<div class="btn-group">
    <a href="<?php echo site_urlc('message/index')?>" class='btn'> <i class="fa fa-arrow-left"></i> <?php echo lang('back_list')?></a>
</div>

<?php include_once 'inc_form_errors.php'; ?>

<div class="boxed">
    <h3> <i class="fa fa-plus"></i> <span class="badge badge-success pull-right"><?php echo $title; ?></span> <?php echo lang('add') ?></h3>
    <?php echo form_open(current_urlc(),array("class"=>"form-horizontal","id"=>"frm-create")); ?>

    <div class="boxed-inner seamless">
        <div class="control-group">
            <label class="control-label" for="title"> <?php echo lang('title') ?> </label>
            <div class="controls">
                <input type="text" id="title" name="title" value="<?php echo set_value("title") ?>" x-webkit-speech>
            </div>
        </div>
            <div class="control-group">
                <label for="title" class="control-label">时间:</label>
                <div class="controls">
                    <div class="input-append date timepicker">
                        <input type="text" value="<?php echo date("Y-m-d H:i:s",set_value('timeline',now())); ?>" id="timeline" name="timeline" data-date-format="yyyy-mm-dd hh:ii:ss">
                        <span class="add-on"><i class="icon-th"></i></span>
                    </div>
                </div>
            </div>
        <!-- ctype -->
        <?php if ($ctype = list_coltypes($this->cid)) { ?>
            <div class="control-group">
                <label class="control-label" for="status"> 所属分类:</label>
                <div class="controls">
                    <?php
                    echo ui_btn_select('ctype',set_value("ctype"),$ctype);
                    ?>
                    <span class="help-inline"></span>
                </div>
            </div>
        <?php } ?>

            <div class="control-group uefull">
                <textarea id="content" name="content" ></textarea>
            </div>

    </div>

    <div class="boxed-footer">
        <input type="hidden" name="cid" value="<?php echo $this->cid ?>">
        <?php if ($this->ccid): ?>
            <input type="hidden" name="ccid" value="<?php echo $this->ccid ?>">
        <?php endif ?>
        <input type="submit" value=" <?php echo lang('submit'); ?> " class='btn btn-primary'>
        <input type="reset" value=' <?php echo lang('reset'); ?> ' class="btn btn-danger">
    </div>
    </form>
</div>

<?php include_once 'inc_ui_media.php'; ?>

<script type="text/javascript">
    require(['adminer/js/ui','adminer/js/media','bootstrap-datetimepicker.zh'],function(ui,media){
        // timepick
        $('.timepicker').datetimepicker({'language':'zh-CN','format':'yyyy/mm/dd hh:ii:ss','todayHighlight':true});
        ui.editor_create('content');
    });

</script>
